package com.ffms.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ffms.service.impl.AdminServiceImpl;
import com.ffms.service.AdminService;
import com.ffms.service.impl.AdminServiceImpl;

@WebServlet("/DeleteFMServlet")
public class DeleteFMServlet extends HttpServlet {


	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		this.doPost(request, response);
	}


	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		//获取要删除的成员姓名
		String name= request.getParameter("name");
		//调用业务层完成删除操作
		AdminService  adminService = new AdminServiceImpl();
		try {
			adminService.deleteFM(name);
			//返回至主页面
			request.getRequestDispatcher("/ShowAllFMServlet").forward(request, response);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}

}
